package com.ruoyi.whzj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.whzj.mapper.WhPayrecordMapper;
import com.ruoyi.whzj.domain.WhPayrecord;
import com.ruoyi.whzj.service.IWhPayrecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户购买记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-30
 */
@Service
public class WhPayrecordServiceImpl implements IWhPayrecordService 
{
    @Autowired
    private WhPayrecordMapper whPayrecordMapper;

    /**
     * 查询用户购买记录
     * 
     * @param id 用户购买记录ID
     * @return 用户购买记录
     */
    @Override
    public WhPayrecord selectWhPayrecordById(String id)
    {
        return whPayrecordMapper.selectWhPayrecordById(id);
    }

    /**
     * 查询用户购买记录列表
     * 
     * @param whPayrecord 用户购买记录
     * @return 用户购买记录
     */
    @Override
    public List<WhPayrecord> selectWhPayrecordList(WhPayrecord whPayrecord)
    {
        return whPayrecordMapper.selectWhPayrecordList(whPayrecord);
    }

    /**
     * 新增用户购买记录
     * 
     * @param whPayrecord 用户购买记录
     * @return 结果
     */
    @Override
    public int insertWhPayrecord(WhPayrecord whPayrecord)
    {
        whPayrecord.setCreateTime(DateUtils.getNowDate());
        return whPayrecordMapper.insertWhPayrecord(whPayrecord);
    }

    /**
     * 修改用户购买记录
     * 
     * @param whPayrecord 用户购买记录
     * @return 结果
     */
    @Override
    public int updateWhPayrecord(WhPayrecord whPayrecord)
    {
        whPayrecord.setUpdateTime(DateUtils.getNowDate());
        return whPayrecordMapper.updateWhPayrecord(whPayrecord);
    }

    /**
     * 删除用户购买记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWhPayrecordByIds(String ids)
    {
        return whPayrecordMapper.deleteWhPayrecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户购买记录信息
     * 
     * @param id 用户购买记录ID
     * @return 结果
     */
    @Override
    public int deleteWhPayrecordById(String id)
    {
        return whPayrecordMapper.deleteWhPayrecordById(id);
    }
}
